﻿<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>运营平台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <meta name="MobileOptimized" content="320">
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <link href="assets/plugins/select2/select2_metro.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="assets/plugins/bootstrap-datepicker/css/datepicker.css" />
    <!-- BEGIN THEME STYLES -->
    <link href="assets/css/style-metronic.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/style.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/style-responsive.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/plugins.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/pages/tasks.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color" />
    <link href="assets/css/custom.css" rel="stylesheet" type="text/css" />
    <!-- END THEME STYLES -->
    <link rel="shortcut icon" href="favicon.ico" />
    <style>
        #orderInfo tr td:first-child { text-align: right; background: #eee; }
        #orderInfo tr td:last-child { text-align: left; }
        .radio-space .radio { padding:0;}
        ul,li { list-style:none;padding:0; }
    </style>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
    <!-- BEGIN HEADER -->
    <div class="header navbar navbar-inverse navbar-fixed-top">
        <!-- BEGIN TOP NAVIGATION BAR -->
        <div class="header-inner">
            <!-- BEGIN LOGO -->
            <a class="navbar-brand" href="index.html">
                <img src="assets/img/logo.png" alt="logo" class="img-responsive" />
            </a>
            <!-- END LOGO -->
            <!-- BEGIN RESPONSIVE MENU TOGGLER -->
            <a href="javascript:;" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <img src="assets/img/menu-toggler.png" alt="" />
            </a>
            <!-- END RESPONSIVE MENU TOGGLER -->
            <!-- BEGIN TOP NAVIGATION MENU -->
            <ul class="nav navbar-nav pull-right">
                <!-- BEGIN USER LOGIN DROPDOWN -->
                <li class="dropdown user">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        <img alt="" src="assets/img/avatar1_small.jpg" />
                        <span class="username">Bob Nilson</span>
                        <i class="icon-angle-down"></i>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="extra_profile.html"><i class="icon-user"></i> My Profile</a>
                        </li>
                        <li>
                            <a href="page_calendar.html"><i class="icon-calendar"></i> My Calendar</a>
                        </li>
                        <li>
                            <a href="inbox.html"><i class="icon-envelope"></i> My Inbox <span class="badge badge-danger">3</span></a>
                        </li>
                        <li>
                            <a href="#"><i class="icon-tasks"></i> My Tasks <span class="badge badge-success">7</span></a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="javascript:;" id="trigger_fullscreen"><i class="icon-move"></i> Full Screen</a>
                        </li>
                        <li>
                            <a href="extra_lock.html"><i class="icon-lock"></i> Lock Screen</a>
                        </li>
                        <li>
                            <a href="login.html"><i class="icon-key"></i> Log Out</a>
                        </li>
                    </ul>
                </li>
                <!-- END USER LOGIN DROPDOWN -->
            </ul>
            <!-- END TOP NAVIGATION MENU -->
        </div>
        <!-- END TOP NAVIGATION BAR -->
    </div>
    <!-- END HEADER -->
    <div class="clearfix"></div>
    <!-- BEGIN CONTAINER -->
    <div class="page-container">
        <!-- BEGIN SIDEBAR -->
        <div class="page-sidebar navbar-collapse collapse">
            <!-- BEGIN SIDEBAR MENU -->
            <ul class="page-sidebar-menu">
                <li>
                    <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                    <div class="sidebar-toggler hidden-phone"></div>
                    <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                </li>
                <li class="start active">
                    <a href="index.html">
                        <i class="icon-home"></i>
                        <span class="title">运营后台</span>
                        <span class="selected"></span>
                    </a>
                </li>
                <li class="">
                    <a href="index.html">
                        <i class="icon-sitemap"></i>
                        <span class="title">数据统计</span>
                    </a>
                </li>
                <li class="">
                    <a href="shop.query.html">
                        <i class="icon-gift"></i>
                        <span class="title">商品管理</span>
                    </a>
                </li>
                <li class="open">
                    <a href="order.query.html">
                        <i class="icon-gift"></i>
                        <span class="title">订单查询</span>
                    </a>
                </li>
                <li class="">
                    <a href="mes.group.html">
                        <i class="icon-gift"></i>
                        <span class="title">消息群发</span>
                    </a>
                </li>
                <li class="">
                    <a href="advice.html">
                        <i class="icon-gift"></i>
                        <span class="title">用户意见</span>
                    </a>
                </li>
            </ul>
            <!-- END SIDEBAR MENU -->
        </div>
        <!-- END SIDEBAR -->
        <!-- BEGIN PAGE -->
        <div class="page-content">
            <!-- BEGIN PAGE HEADER-->
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">保养券设置</h3>
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="icon-home"></i>
                    <a href="index.html">主页</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li><a href="#">保养券设置</a></li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->
            <div class="portlet box blue" id="dealerQuery">
                <div class="portlet-title">
                    <div class="caption">保养券设置</div>
                </div>
                <div class="portlet-body form">
                    <!-- BEGIN FORM-->
                    <form action="#" class="form-horizontal">
                        <div class="form-body">
                            <div class="form-group">
                                <label class="control-label col-md-2"><span style="color: red">*&nbsp;</span>有效期</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control" value="7" id="validDays">
                                </div>
                                <label class="control-label ">天</label>
                              <!--  <label class="radio-space"><input type="radio" name="m" /></label>-->
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-2"><span style="color: red">*&nbsp;</span>金额</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control" id="amount" value="200.00">
                                </div>
                                <label class="control-label ">元</label>
                                <!--  <label class="radio-space"><input type="radio" name="m" /></label>-->
                            </div>
                            <!--  <div class="form-group">
                                 <label class="control-label col-md-1">适用城市</label>
                                 <div class="col-md-3">
                                     <input type="text" class="form-control">
                                 </div>
                                 <label class="control-label ">元</label>
                             </div>-->
                             <hr />
                             <div class="form-group">
                                 <label class="control-label col-md-2"><span style="color: red">*&nbsp;</span>适用城市</label>
                                 <div class="col-md-6" style="padding-top:7px;">
                                     <ul class="checkbox-list form-group">
                                         <li class="col-md-4"><input type="checkbox" value="福安周" name="city" /><label id="哈哈">广州</label></li>
                                         <li class="col-md-4"><input type="checkbox"  value="1"name="city" /><label>广州</label></li>
                                         <li class="col-md-4"><input type="checkbox"  value="2"name="city" /><label>广州</label></li>
                                         <li class="col-md-4"><input type="checkbox" value="3" name="city" /><label>广州</label></li>
                                         <li class="col-md-4"><input type="checkbox" value="4" name="city" /><label>广州</label></li>
                                         <li class="col-md-4"><input type="checkbox"  value="5"name="city" /><label>广州</label></li>
                                         <li class="col-md-4"><input type="checkbox"  value="6"name="city" /><label>广州</label></li>
                                         <li class="col-md-4"><input type="checkbox" value="7" name="city" /><label>广州</label></li>
                                         <li class="col-md-4"><input type="checkbox"  value="8"name="city" /><label>广州</label></li>


                                     </ul>
                                 </div>
                             </div>
                             <div class="form-group">
                                 <label class="control-label col-md-2"><span style="color: red">*&nbsp;</span>适用品牌</label>
                                 <div class="col-md-6" style="padding-top:7px;">
                                     <ul class="checkbox-list form-group">
                                         <li class="col-md-4"><input value="1" type="checkbox" name="brand" /><label id="2323">广州</label></li>
                                         <li class="col-md-4"><input value="1" type="checkbox" name="brand" /><label>广州</label></li>
                                         <li class="col-md-4"><input value="1" type="checkbox" name="brand" /><label>广州</label></li>
                                         <li class="col-md-4"><input value="1" type="checkbox"  name="brand"/><label>广州</label></li>
                                         <li class="col-md-4"><input  value="1"type="checkbox" name="brand" /><label>广州</label></li>
                                         <li class="col-md-4"><input  value="1"type="checkbox" name="brand" /><label>广州</label></li>
                                         <li class="col-md-4"><input  value="1"type="checkbox"  name="brand"/><label>广州</label></li>
                                         <li class="col-md-4"><input  value="1"type="checkbox" name="brand" /><label>广州</label></li>
                                         <li class="col-md-4"><input value="1"type="checkbox"  name="brand"/><label>广州</label></li>
                                         <li class="col-md-4"><input value="1" type="checkbox" name="brand" /><label>广州</label></li>
                                         <li class="col-md-4"><input value="1" type="checkbox" name="brand" /><label>广州</label></li>
                                         <li class="col-md-4"><input  value="1"type="checkbox"  name="brand"/><label>广州</label></li>
                                     </ul>
                                 </div>
                             </div>
                             <div class="form-group">
                                 <label class="control-label col-md-1">备注</label>
                                 <div class="col-md-6" style="padding-top:7px;">
                                     <textarea class="form-control" style="height:100px;" id="memo"></textarea>
                                 </div>
                             </div>
                             <div class="form-group">
                                 <label class="control-label col-md-1"></label>
                                 <div class="col-md-6 text-right">
                                     <span class="btn blue" onclick="addCoupon()" type="button">确认</span>
                                 </div>
                             </div>
                             <div class="dataTable clearfix">
                                 <table class="table table-bordered table-hover">
                                     <thead>
                                         <tr>
                                             <th>有效期</th>
                                             <th>截止日期</th>
                                             <th>金额</th>
                                             <th>修改时间</th>
                                             <th>城市</th>
                                             <th>品牌</th>
                                             <th>备注</th>
                                             <th>操作</th>
                                         </tr>
                                     </thead>
                                     <tbody>
                                         <tr>
                                             <td>7</td>
                                             <td>7</td>
                                             <td>7</td>
                                             <td>7</td>
                                             <td>7</td>
                                             <td>7</td>
                                             <td>7</td>
                                             <td><span class="btn blue " onclick="city()">启动 </span>
                                                 <span class="btn blue">停止 </span></td>
                                         </tr>
                                     </tbody>
                                 </table>

                             </div>
                         </div>
                     </form>
                     <!-- END FORM-->
                </div>
            </div>
            <!-- END PAGE HEADER-->
        </div>
        <!-- END PAGE -->
    </div>
    <!-- END CONTAINER -->
    <!-- BEGIN FOOTER -->
    <div class="footer">
        <div class="footer-inner">
            2013 &copy; Metronic by keenthemes.
        </div>
        <div class="footer-tools">
            <span class="go-top">
                <i class="icon-angle-up"></i>
            </span>
        </div>
    </div>

    <!-- END FOOTER -->
    <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
    <!-- BEGIN CORE PLUGINS -->
    <!--[if lt IE 9]>
    <script src="assets/plugins/respond.min.js"></script>
    <script src="assets/plugins/excanvas.min.js"></script>
    <![endif]-->
    <script src="assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
    <script src="assets/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <script src="assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
    <script src="assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <script src="assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>
    <script src="assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
    <script src="assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->
    <script type="text/javascript" src="assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script src="assets/plugins/select2/select2.min.js"></script>
    <script type="text/javascript" src="assets/plugins/data-tables/jquery.dataTables.js"></script>
    <script type="text/javascript" src="assets/plugins/data-tables/DT_bootstrap.js"></script>
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="assets/scripts/app.js" type="text/javascript"></script>
    <script src="assets/scripts/table.js"></script>
    <!-- END PAGE LEVEL SCRIPTS -->
    <script>
        jQuery(document).ready(function () {

            App.init();
            OrderQuery.init();
            $("select.form-control").select2();
            $('.date-picker').datepicker({
                rtl: App.isRTL(),
                autoclose: true
            });
            $("#dealerInfo").hide();
            $("#viewDealer").click(function () {
                $("#dealerQuery").hide();
                $("#dealerInfo").show();
            })

        });
        function unique(arr) {
            var ret = []
            var hash = {}

            for (var i = 0; i < arr.length; i++) {
                var item = arr[i]
                var key = typeof(item) + item
                if (hash[key] !== 1) {
                    ret.push(item)
                    hash[key] = 1
                }
            }

            return ret
        }



        function addCoupon(){
            var  cityList = new Array();
            var  brandList = new Array();
            var  amount =$("#amount").val();
            var validDays=$("#validDays").val();
            var memo=$("#memo").val();
            var states =0;
            var city={};
            var brand={};
           for( var k = 0 ; k <$("input[name='city']").length ; k++){
               if($("input[name='city']")[k].checked){
                city.cityName =$($("input[name='city']")[k]).parent().parent().next("label").text();
                city.cityCode = $("input[name='city']")[k].value;
                cityList.push(city)
               }
           }
            for( var i = 0 ; i <$("input[name='brand']").length ; i++){
                if($("input[name='brand']")[i].checked){
                    brand.cityName =$($("input[name='brand']")[i]).parent().parent().next("label").text();
                    brand.cityCode = $("input[name='brand']")[i].value;
                    brandList.push(brand)
                }
            }
            var param={
                validDays:validDays,
                amount: amount,
                states:states,
                memo: memo,
                cityList:cityList,
                brandList:brandList
            }
            console.log(JSON.stringify(param))
        }
    </script>
    <!-- END
     {
    validDays: 8,
    amount: 100.00,
    states: 0,
    memo: 备注,
    cityList: [
        {
            cityName: 汤斐,
            cityCode: 1
        }
    ],
    brandList: [
        {
            brandName: tangfei,
            brandId: 1
        }
    ]
}


     JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>